{if $GLOBALS.is_ajax || $smarty.get.ajax_submit}

	<div id="classifieds_video_{if $complexField}{$complexField}_{$id}_{$complexStep}{else}{$id}{/if}">
	{if $complexField && $filesInfo.$complexStep.file_name ne null}
		<div class="complex-view-file-caption">
			<a onclick="popUpWindow('{$GLOBALS.site_url}/video-player/?listing_id={$listing.id}&amp;field_id={$id}&amp;complexParent={$complexField}&amp;complexEnum={$complexStep}', 282, 300, 'VideoPlayer'); return false;" href="{$GLOBALS.site_url}/video-player/?listing_id={$listing.id}&amp;field_id={$id}&amp;complexParent={$complexField}&amp;complexEnum={$complexStep}"> [[Watch a video]]</a>
			|
			{if $copy_listing ne null}
				{*<a href="{$GLOBALS.site_url}/clone-job/?listing_id={$listing_id}&amp;action=delete&amp;field_id={$id}&amp;complexParent={$complexField}&amp;complexEnum={$complexStep}">[[Remove]]</a>
				<input type="hidden" name="{$id}_hidden{if $complexField}[{$complexStep}]{/if}" value="1" />*}
			{else}
				<a class="delete_video_complex"
					 listing_id="{if $listing_id}{$listing_id}{else}{$listing.id}{/if}"
					 field_id="{$complexField}:{$id}:{$complexStep}"
					 file_id="{$filesInfo.$complexStep.file_id}"
					 href="{$GLOBALS.site_url}/classifieds/delete-complex-file/?listing_id={$listing.id}&amp;field_id={$complexField}:{$id}:{$complexStep}&amp;file_id={$filesInfo.$complexStep.file_id}">[[Remove]]</a>

			{/if}
			<br/><br/>
		</div>
		<input type="hidden" field_id="{$id}" field_action="upload_classifieds_video" field_target="#video_field_content_{$id}" id="hidden_{$complexField}_{$id}_{$complexStep}" name="{$complexField}[{$id}][{$complexStep}]" value="{$filesInfo.$complexStep.file_id}" class="complexField"/>
	{elseif !$complexField && $value.file_name ne null && $url != '/add-listing/'}
		<a onclick="popUpWindow('{$GLOBALS.site_url}/video-player/?listing_id={$listing.id}&amp;field_id={$id}', 282, 300, 'VideoPlayer'); return false;" href="{$GLOBALS.site_url}/video-player/?listing_id={$listing.id}&amp;field_id={$id}"> [[Watch a video]]</a>
		|
		{if $copy_listing ne null}
			<a href="{$GLOBALS.site_url}/clone-job/?listing_id={$listing_id}&amp;action=delete&amp;field_id={$id}">[[Remove]]</a>
			<input type="hidden" name="{$id}_hidden{if $complexField}[{$complexStep}]{/if}" value="1" />
		{else}
			<a class="delete_classifieds_video" listing_id="{if $listing_id}{$listing_id}{else}{$listing.id}{/if}" field_id="{$id}" file_id="{$value.file_id}" href="{$GLOBALS.site_url}/classifieds/delete-uploaded-file/?listing_id={$listing.id}&amp;field_id={$id}">[[Remove]]</a>
		{/if}
		<br/><br/>
	{/if}
	</div>

	<input type="file"
		   field_id="{if $complexField}{$complexField}:{$id}:{$complexStep}{else}{$id}{/if}"
		   field_action="upload_classifieds_video{if $complexField}_complex{/if}"
		   field_target="#video_field_content_{if $complexField}{$complexField}_{$id}_{$complexStep}{else}{$id}{/if}"
		   name="{if $complexField}{$complexField}[{$id}][{$complexStep}]{else}{$id}{/if}"
		   class="autouploadField {if $complexField}complexField{/if}" />

	<span id="video_uploader_image_{if $complexField}{$complexField}_{$id}_{$complexStep}{else}{$id}{/if}" style="display: none;">&nbsp;<img src="{$GLOBALS.user_site_url}/templates/_system/main/images/ajax_preloader_circular_16.gif" /></span>

{else}


	<div id="video_field_content_{if $complexField}{$complexField}_{$id}_{$complexStep}{else}{$id}{/if}">

		<div class="errors"></div>

		<div id="classifieds_video_{if $complexField}{$complexField}_{$id}_{$complexStep}{else}{$id}{/if}}">
		{if $complexField && $filesInfo.$complexStep.file_name ne null}
			<div class="complex-view-file-caption">
				<a onclick="popUpWindow('{$GLOBALS.site_url}/video-player/?listing_id={$listing.id}&amp;field_id={$id}&amp;complexParent={$complexField}&amp;complexEnum={$complexStep}', 282, 300, 'VideoPlayer'); return false;" href="{$GLOBALS.site_url}/video-player/?listing_id={$listing.id}&amp;field_id={$id}&amp;complexParent={$complexField}&amp;complexEnum={$complexStep}"> [[Watch a video]]</a>
				|
				{if $copy_listing ne null}
					{*<a href="{$GLOBALS.site_url}/clone-job/?listing_id={$listing_id}&amp;action=delete&amp;field_id={$id}&amp;complexParent={$complexField}&amp;complexEnum={$complexStep}">[[Remove]]</a>
					<input type="hidden" name="{$id}_hidden{if $complexField}[{$complexStep}]{/if}" value="1" />*}
				{else}
					<a class="delete_video_complex"
						 listing_id="{if $listing_id}{$listing_id}{else}{$listing.id}{/if}"
						 field_id="{$complexField}:{$id}:{$complexStep}"
						 file_id="{$filesInfo.$complexStep.file_id}"
						 href="{$GLOBALS.site_url}/classifieds/delete-complex-file/?listing_id={$listing.id}&amp;field_id={$complexField}:{$id}:{$complexStep}&amp;file_id={$filesInfo.$complexStep.file_id}">[[Remove]]</a>
				{/if}
				<br/><br/>
			</div>
			<input type="hidden" id="hidden_{$complexField}_{$id}_{$complexStep}" name="{$complexField}[{$id}][{$complexStep}]" value="{$filesInfo.$complexStep.file_id}" class="complexField"/>
		{elseif !$complexField && $value.file_name ne null && $url != '/add-listing/'}
			<a onclick="popUpWindow('{$GLOBALS.site_url}/video-player/?listing_id={$listing.id}&amp;field_id={$id}', 282, 300, 'VideoPlayer'); return false;" href="{$GLOBALS.site_url}/video-player/?listing_id={$listing.id}&amp;field_id={$id}"> [[Watch a video]]</a>
			|
			{if $copy_listing ne null}
				<a href="{$GLOBALS.site_url}/clone-job/?listing_id={$listing_id}&amp;action=delete&amp;field_id={$id}">[[Remove]]</a>
				<input type="hidden" name="{$id}_hidden{if $complexField}[{$complexStep}]{/if}" value="1" />
			{else}
				<a class="delete_classifieds_video" listing_id="{if $listing_id}{$listing_id}{else}{$listing.id}{/if}" field_id="{$id}" file_id="{$value.file_id}" href="{$GLOBALS.site_url}/classifieds/delete-uploaded-file/?listing_id={$listing.id}&amp;field_id={$id}">[[Remove]]</a>
			{/if}
			<br/><br/>
		{/if}
		</div>

		<input type="file"
			   field_id="{if $complexField}{$complexField}:{$id}:{$complexStep}{else}{$id}{/if}"
			   field_action="upload_classifieds_video{if $complexField}_complex{/if}"
			   field_target="#video_field_content_{if $complexField}{$complexField}_{$id}_{$complexStep}{else}{$id}{/if}"
			   name="{if $complexField}{$complexField}[{$id}][{$complexStep}]{else}{$id}{/if}"
			   class="autouploadField {if $complexField}complexField{/if}" />

		<span id="video_uploader_image_{if $complexField}{$complexField}_{$id}_{$complexStep}{else}{$id}{/if}" style="display: none;">&nbsp;<img src="{$GLOBALS.user_site_url}/templates/_system/main/images/ajax_preloader_circular_16.gif" /></span>

	</div>



	<script>
		{literal}

		// check temporary uploaded data of field
		$(function() {
			{/literal}
			{if $complexField}
				getComplexClassifiedsVideoData('{$complexField}:{$id}:{$complexStep}', '{if $listing_id}{$listing_id}{else}{$listing.id}{/if}', '{if $listing.type.id}{$listing.type.id}{/if}');
			{else}
				getClassifiedsVideoData('{$id}', '{if $listing_id}{$listing_id}{else}{$listing.id}{/if}');
			{/if}
			{literal}
		});

		{/literal}
	</script>

{/if}